﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Fish_Atlantis.Account
{
    public partial class Register : System.Web.UI.Page
	{
        //DataSet ds;
		protected void Page_Load(object sender, EventArgs e)
		{

		}
       protected void btn_sub_Click(object sender, EventArgs e)
        {
            
            string type=(select.SelectedIndex+1).ToString();
            string sql="INSERT INTO Users (UserName,Password,Email,Phonenumber,User_Type) VALUES ('"+Text1.Value.ToString()+"','"+Text2.Value.ToString()+"','"+Text4.Value.ToString()+"','"+Text5.Value.ToString()+"',"+type+")";
            if(Helper.ExecSQL(sql))
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script language='javascript'>alert('注册成功！');location.href='/Account/Login.aspx';</script>");
            else
            {
                Response.Write("<script language='javascript'>alert('注册失败！');</script>");
            }

        }
	}
}